<%--
 *  File:    PrivListEdit.jsp
 *  @Author: Langerwang 
 *  Date:    2001/11/27
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.util.OvalLabel" %>
<%@ page import="com.oval.util.OvalCustomMessage" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<% //--------------------------------------  setting logger --%>
<%
  	Category cat = Category.getInstance("jsp.PrivListEdit"); 
%>

<%
	  String privilegeCode = "Z0201,L403";
	  String strModuleName = "UPM";
%>



<%//--------------------------------------  include files list --%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/PageDefault.inc" %>

<html>
<head>
<title>PrivListEdit</title>
<%if(request.getParameter("privlistid") != null){%>
<PageFlow:CheckPageFlow pageName="privlistedit"/> 
<%@ include file="/inc/InitEdit.inc" %>
<%}%> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../../css/<%= strLanguageCode %>/script.js">
</script>
<script language="JavaScript" src="../../js/FuncLib.js"></script>
<script language="JavaScript" src="../../js/ScriptLib.js"></script>
<%
  HashMap privList = (HashMap)pageContext.getAttribute("privlistinfo");
  String privListId = new String("");
  String strPrivListCode = new String("");  
  String strPrivListName = new String("");
  String strDescription = new String("");
  String strReadOnly = "";
  
  //get privlist
  if(privList == null  || privList.isEmpty())
  {
    privList = new HashMap();
  }  
  else
  {
    strReadOnly = "ReadOnly";
    privListId = (privList.get("privlistid")).toString();
    strPrivListCode = (String)privList.get("privlistcode");
    strPrivListName = (String)privList.get("privlistname");
  }    
  cat.debug("The privlist is :" + privList);  
%>
<script language="JavaScript">
function page_done()
{
  if(!checkForm(document.privlisteditform)) return;     
  if(!checkNull(document.privlisteditform)) return;

  MLCSTransform(document.privlisteditform);
  emptyToNull(document.privlisteditform);         

  document.privlisteditform.actionname.value = "done";
  isRunning = true;
  document.privlisteditform.submit();
}
var popwindow;
function page_mulilang(name,label,num,need)
{
  
  if(popwindow!=null)
    popwindow.close();
  var strurl="../../common/Lang.jsp?<%= OvalTools.randomURL() %>&form=privlisteditform&module=UPM&mlctype="+label+"&nativelanguage="+need+"&schema=ovprivlistlang&entityid=<custom:write name="privlistinfo" property="privlistid"/>&entitytype="+name+"&contentid=privlistlangid&colindex="+num;
  var strStatus= "height=250, width=250,top=100,left=100,toolbar=n0, menubar=no, scrollbars=no, resizable=no, location=no, status=no";
  popwindow=window.open(strurl, "newwindow",strStatus);
}
</script>
</head>

<body>
<table width="100%" cellspacing="0" cellpadding="0">
  <tr> 
    <td colspan="2" class="summary_top"></td>
  </tr>
  <tr> 
    <td colspan="2"><img src="../../images/<%= strLanguageCode %>/quote.gif" width="16" height="11"> 
      <%= label.getLabelName("L_UpdatePL") %><%= label.getLabelName("L_Colon") %></td>
  </tr>
</table>
<table width="100%" cellspacing="0" border="0" cellpadding="0">
  <tr> 
    <td> 
      <table width="100%" border="1" cellpadding="2" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
       <form name="privlisteditform" method="post" action="../../Dispatcher" target="_parent">
       <input type="hidden" name="pagename" value="privlistedit">
       <input type="hidden" name="actionname">
       <%
         if(! privList.isEmpty()){
       %>
       <input type="hidden" name="privlistid" value="<%=JspHelper.filterNull( privListId )%>"> 
       <%}%>
       <custom:hidden scope="session" property="languagecode" /> 
       <input type="hidden" name="numrows" value="<%=JspHelper.filterNull( new Integer(2) )%>"> 
       
        <tr> 
          <td class="need" width="146"> <%= label.getLabelName("L_PrivListCode")%><%= label.getLabelName("L_Colon") %></td>
          <td> 
            <input type="text" name="privlistcode" size="15" <%=JspHelper.filterNull( strReadOnly )%> value="<%=JspHelper.filterNull( strPrivListCode )%>">
          </td>
        </tr>
        <tr> 
          <td class="need"> <%= label.getLabelName("L_PrivListName") %><%= label.getLabelName("L_Colon") %></td>
          <td> 
            <custom:text name="privlistinfo" property="privlistname" size="42" command="notnull" module="UPM" label="L_PrivListName" needMLC="true" isFirstMLC="true" multiLangType="prln" entityId="privlistid" contentId="privlistlangid" colIndex="0"/>
            <a onclick="page_mulilang('prln','L_PrivListName',0,'');"><custom:button type="3" label="L_Ln" imgsrc="ln.gif" border="0"/></a> 
          </td>
        </tr>
        <tr> 
          <td class="td-text"> <%= label.getLabelName("L_PrivListDesc") %><%= label.getLabelName("L_Colon") %></td>
          <td> 
            <custom:text name="privlistinfo" property="privlistdesc" size="42"  module="UPM" label="L_PrivListDesc" needMLC="true"  multiLangType="prld"  colIndex="0"/>
            <a onclick="page_mulilang('prld','L_PrivListDesc',0,'');"><custom:button type="3" label="L_Ln" imgsrc="ln.gif" border="0"/></a> 
          </td>
        </tr>
      </table>
     </form>      
    </td>
  </tr>
  <tr> 
    <td class="summary_top"></td>
  </tr>
  <tr> 
    <td class="td_center"><a onclick="page_done()"><custom:button type="1" label="L_Finish" imgsrc="finish.gif" border="0" style="width:60"/></a></td>
  </tr>
</table>
</body>
</html>


